package lntu.cn.cxxd0927;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.View;
import android.widget.Toast;

public class ActivityLife extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_life);
        Log.i("activity","onCreate()被调用了");

    }

    @Override//方法重写e
    protected void onStart() {
        super.onStart();
        Log.i("activity","onStart()被调用了");
    }

    @Override
    protected void onResume() {
        super.onResume();
        Log.i("activity","onResume()被调用了");
    }

    @Override
    protected void onPause() {
        super.onPause();
        Log.i("activity","onPause()被调用了");
    }

    @Override
    protected void onStop() {
        super.onStop();
        Log.i("activity","onStop()被调用了");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.i("activity","onDestroy()被调用了");
    }

    public void exitpro(View view) {//当前的activity调用它
        //finish();  //关闭
        //oast.makeText(this,"注册成功",Toast.LENGTH_SHORT).show();  //上下文

        //显示Intent,通常用在同一个项目中，不同的Activity跳转
        Intent intent=new Intent(this,MainActivity.class);
        startActivity(intent);
        //隐式
        //不同应用程序的跳转
        /*Intent intent=new Intent();
        intent.setAction("cn.lntu.MainAct");
        startActivity(intent);*/
    }
}
